
Page({

  /**
   * 页面的初始数据
   */
  data: {
    schema:[
      {
        label:'页面最小宽度（ px 为单位）',
        prop:'min-width',
        type:'number'
      },
      {
        label:'页面最大宽度（ px 为单位）',
        prop:'max-width',
        type:'number'
      },
      {
        label:'页面宽度（ px 为单位）',
        prop:'width',
        type:'number'
      },
      {
        label:'页面最小高度（ px 为单位）',
        prop:'min-height',
        type:'number'
      },
      {
        label:'页面最大高度（ px 为单位）',
        prop:'max-height',
        type:'number'
      },
      {
        label:'页面高度（ px 为单位）',
        prop:'height',
        type:'number'
      },
      {
        label:'屏幕方向（ landscape 或 portrait ）',
        prop:'orientation',
        type:'picker',
        labelOptions:['横屏','竖屏'],
        valueOptions:['landscape', 'portrait']
      },
    ],
    formData:{
      'min-width': 300,
      'max-width': 600,
      orientation: 'portrait'
    },
    title: '',
    result: '',
    remark: '',
    webUrl: '',
    windowInfo: {}
  },
  onLoad(options) {
    console.log('options', options)
    wx.setNavigationBarTitle({
      title: options.title,
    })
    
    this.setData({
      title: options.title,
      zh:options.zh,
      remark: options.remark,
      webUrl: options.webUrl
    })
    const windowInfo = wx.getSystemInfoSync();
    this.setData({
      windowInfo: windowInfo
    })
    wx.onWindowResize((res) => {
      const windowInfo = wx.getSystemInfoSync();
      this.setData({
        windowInfo: windowInfo
      })
    })
  },
  getFormData(e) {
    console.log('formdata==', e.detail.formData);
    this.setData({
      formData: e.detail.formData
    })
  },
  choose1() {
    const that = this;
  },
  onUnload() {
  }
})